/*
 * ThreadEngineSpin.cpp
 *
 *  Created on: Jan 27, 2013
 *      Author: Drew Prevost
 */

#include "ThreadEngineSpin.h"

ThreadEngineSpin::ThreadEngineSpin(
                                    ThreadServoRate & threadServoExhaust,
                                    uint8_t nPinGlowPlug,
                                    uint8_t nPinGenConnect,
                                    uint8_t nPinStarterMotor,
                                    uint8_t nPinGenDisonnect,
                                    uint8_t nPinGenMonitor )
    : ThreadEngineBase( threadServoExhaust, nPinGlowPlug, nPinGenConnect, nPinStarterMotor, nPinGenDisonnect, nPinGenMonitor )
{
}

ThreadEngineSpin::~ThreadEngineSpin()
{
}

bool ThreadEngineSpin::run()
{
  threadMicroDelay.run();

  PT_BEGIN()
  ;

  digitalWrite( nPinStarterMotor, HIGH );
  threadMicroDelay.setDelay( 1000000 );
  PT_SPAWN( threadMicroDelay );
  digitalWrite( nPinStarterMotor, LOW );

PT_END()
;
return false;
}
